<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>网上商城</title>
    <link rel="stylesheet" th:href="@{~/bootstrap/css/bootstrap.min.css}">
    <script th:src="@{~/js/jquery-3.2.1.min.js}"></script>
    <style>
        .content{
            margin: auto;
            width: 800px;

        }
        .img{
            width: 150px;
            height: 180px;
            padding: 5px;
            overflow: hidden;
        }
    </style>
</head>
<body>
    <div class="container">
        <nav class="navbar navbar-inverse">
            <ul class="nav navbar-nav">
                <li class=""><a th:href="@{/preindex/preindex}">首页</a></li>
                <li><a th:href="@{/order/order}">订单</a></li>
                <li><a href=""></a></li>
                <li><a href=""></a></li>
                <li>
                    <!--欢迎：<span th:text="${session.user.uname==null?'':session.user.uname}"></span>-->
                </li>

            </ul>
        </nav>
        <div class="content">
            <div class="row">
                <div class="col-md-3" th:each="goods : ${goodsList}">
                    <div class="img">
                        <a th:href="@{/preindex/onlygoods/{id}(id=${goods.id})}">
                            <img with="250" height="150" class="img-rounded" th:src="@{~/img/{img}(img=${goods.img})}" alt="">
                        </a>
                    </div>
                    <p></p>
                    <p><i>名称：</i><b th:text="${goods.goodsname}"></b>&nbsp;&nbsp;&nbsp;&nbsp;<i>价格：</i><b th:text="${goods.price}">3.5</b></p>
                </div>
            </div>
        </div>
        <tfoot>
        <nav aria-label="Page navigation">
            <ul class="pagination">
                <li>
                    <a th:href="@{/preindex/preindex(current=${current - 1==0?1:current - 1})}" aria-label="Previous">
                        <span aria-hidden="true">&laquo;</span>
                    </a>
                </li>
                <li th:attr="class=${current == num?'active':''}" th:each="num : ${#numbers.sequence(1,page)}">
                    <a th:href="@{/preindex/preindex(current=${num})}" th:text="${num}">1</a>
                </li>
                <li>
                    <a th:href="@{/preindex/preindex(current=${current + 1>page?page:current + 1})}" aria-label="Next">
                        <span aria-hidden="true">&raquo;</span>
                    </a>
                </li>
            </ul>
        </nav>
        </tfoot>
    </div>
</body>
</html>